//第三方app配置表单
import { FormSchema } from '/@/components/Form';

//第三方app表单
export const zhuyunFormSchema: FormSchema[] = [
  {
    label: 'id',
    field: 'id',
    component: 'Input',
    show: false,
  },
  {
    label: 'AppKey',
    field: 'clientId',
    component: 'Input',
    required: true,
  },
  {
    label: 'AppSecret',
    field: 'clientSecret',
    component: 'Input',
    required: true,
  },
  {
    label: '获得token地址',
    field: 'tokenUri',
    component: 'Input',
    rules: [
      {
        required: true,
        message: '请输入token地址',
      },
      {
        pattern: /^(https?:\/\/).+/,
        message: 'token地址以http://或https://开头!',
      },
    ],
  },
  {
    label: '用户信息地址',
    field: 'userInfoUri',
    component: 'Input',
    required: true,
    rules: [
      {
        required: true,
        message: '请输入用户信息地址',
      },
      {
        pattern: /^(https?:\/\/).+/,
        message: '地址以http://或https://开头!',
      },
    ],
  },
  {
    label: '回调重定向地址',
    field: 'redirectUri',
    component: 'Input',
    rules: [
      {
        required: true,
        message: '请输入用户信息地址',
      },
      {
        pattern: /^(https?:\/\/).+/,
        message: '地址以http://或https://开头!',
      },
    ],
  },
  {
    label: '统一退出地址',
    field: 'loginOutUri',
    component: 'Input',
    rules: [
      {
        required: true,
        message: '请输入用户信息地址',
      },
      {
        pattern: /^(https?:\/\/).+/,
        message: '地址以http://或https://开头!',
      },
    ],
  },
  {
    label: '登录名',
    field: 'userNameAttribute',
    component: 'Input',
    required: true,
  },
  {
    label: '登录地址',
    field: 'authorizationUri',
    component: 'Input',
    rules: [
      {
        required: true,
        message: '请输入登录地址地址',
      },
      {
        pattern: /^(https?:\/\/).+/,
        message: '地址以http://或https://开头!',
      },
    ],
  },
  {
    label: '二维码地址',
    field: 'qrcodeUri',
    component: 'Input',
    rules: [
      {
        required: false,
        message: '请输入二维码地址',
      },
      {
        pattern: /^(https?:\/\/).+/,
        message: '地址以http://或https://开头!',
      },
    ],
  },
  {
    label: 'issuer地址',
    field: 'issuerUri',
    component: 'Input',
    required: false,
  },
  {
    label: 'scope',
    field: 'scope',
    component: 'Input',
    required: false,
  },
  {
    field: 'linkType',
    label: '链接类型',
    component: 'RadioButtonGroup',
    componentProps: {
      options: [
        { label: '新窗口', value: 'open' },
        { label: '嵌入', value: 'iframe' },
      ],
    },
  },
  {
    label: '返回类型',
    field: 'responseType',
    component: 'Input',
    required: false,
  },
  {
    field: 'isLoginout',
    label: '是否统一退出',
    component: 'RadioButtonGroup',
    componentProps: {
      options: [
        { label: '是', value: 1 },
        { label: '否', value: 0 },
      ],
    },
  },
  {
    field: 'status',
    label: '是否启用',
    component: 'RadioButtonGroup',
    componentProps: {
      options: [
        { label: '是', value: 1 },
        { label: '否', value: 0 },
      ],
    },
  },
];
